#导包
from pyecharts.charts import Line
from pyecharts import options as opts
from pyecharts.options import TitleOpts,LegendOpts,ToolboxOpts,VisualMapOpts,AxisOpts,AxisLineOpts
#创建折线图
line = Line()
line = Line(init_opts=opts.InitOpts(theme="blue"))
#创建x轴
line.add_xaxis(["中国", "美国", "日本"])
#创建y轴
line.add_yaxis("gdp", [100, 200, 300])
#全局配置
line.set_global_opts(
    title_opts=TitleOpts(title="GDP展示", pos_left="center", pos_bottom="1%"),
    legend_opts=LegendOpts(is_show=True),
    toolbox_opts=ToolboxOpts(is_show=True),
    yaxis_opts=AxisOpts(
        is_show=True,
        axisline_opts=AxisLineOpts(
            is_show=True,
            linestyle_opts={"color": "#333", "width": 2}  # 设置y轴线为深色且加粗
        )
    )
)
line.render("gdp.html")
line.render("gdp.html")